package org.example.domain.model.entity.url;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;


@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "地区统计访问实体")
public class UrlShortenerLocaleStats {

    @Schema(description = "")
    private Long id;

    @Schema(description = "完整短链接")
    private String fullShortUrl;

    @Schema(description = "访问量")
    private Integer cnt;

    @Schema(description = "省份名称")
    private String province;

    @Schema(description = "市名称")
    private String city;

    @Schema(description = "城市编码")
    private String adcode;

    @Schema(description = "国家标识")
    private String country;

    @Schema(description = "访问时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyy-MM-dd")
    private Date accessDate;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "UTF-8")
    @DateTimeFormat(pattern = "yyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "UTF-8")
    @DateTimeFormat(pattern = "yyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @Schema(description = "删除标识, true:已删除, false:未删除")
    @TableField(fill = FieldFill.INSERT)
    private Boolean deleteIdentity;

}
